package com.mf.exceptions;


import com.mf.result.ResultCodeEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 自定义异常
 * 目的：统一处理异常信息
 *      便于解耦，拦截器、service与controller 异常错误的解耦，
 *      不会被service返回的类型而限制
 */

@Getter
@Setter
public class MyCustomException extends RuntimeException {

    private ResultCodeEnum resultCodeEnum;


    public MyCustomException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.resultCodeEnum = resultCodeEnum;
    }
}
